package fregat.connector.channel;


/**
 * Interface for classes that want to listen to a channel.
 *
 * @author Alexander Mann <br><b><i>ECO_L O G</i> &nbsp Logistiksysteme GmbH</b>
 * @version 1.0
 */
public interface ChannelListener {

  /**
   * Called by channel when data was received.
   *
   * @param channelName  Configuration name of channel where data was received
   * @param receivedData Received data
   */
  boolean received(String channelName, byte[] receivedData);

  /**
   * Informs the listener that channel was closed.
   */
  void shutdown();

  /**
   * Informs the listener that channel was opened.
   */
  void start();

  /**
   * Informs the listener about the connection state.
   *
   * @param b True, if connected
   */
  void connected(boolean b);
}
